package com.ycy.dubbo.consumer;

import com.ycy.dubbo.client.TimeService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloWordController {

  @DubboReference(timeout = 1000, retries = 2)
  TimeService timeService;

  @RequestMapping(value = "helloword")
  @ResponseBody
  public String test1() {
    String time = timeService.getTimeout();
    System.out.println(time);
    return time;
  }

}
